("use strict");

const Controller = require("egg").Controller;

class UserController extends Controller {
  async info() {
    const ctx = this.ctx;
    const userId = ctx.params.id;
    const user = await ctx.service.user.find(1);
    ctx.body = user;
  }
  async insert() {
    const ctx = this.ctx;
    const result = await ctx.service.user.insert({
        username: 'hyy',
        age: 2
    });
    ctx.body = result;
  }
}

module.exports = UserController;
